# ./.vscode/launch.json
snippet jsoncc_cppdbg
  {
    "version": "0.2.0",
    "configurations": [
      {
        "cwd": "\${workspaceFolder}",
        "program": "bin/main",
        "name": "lvgl test",
        "request": "launch",
        "type": "cppdbg",
        "runToEntryPoint": "main"
      }
    ]
  }
snippet jsonjlink
  {
    "version": "0.2.0",
    "configurations": [
      {
        "cwd": "\${workspaceFolder}",
        "executable": "build/${1:program}.elf",
        "name": "Cortex Debug",
        "request": "launch",
        "type": "cortex-debug",
        "runToEntryPoint": "main",
        "servertype": "openocd",
        "showDevDebugOutput": "raw",
        "svdFile": "\${workspaceRoot}/STM32F103xx.svd",
        "configFiles": [
          "\${env:openocd_path}/scripts/interface/jlink.cfg",
          "\${env:openocd_path}/scripts/target/${2:target}.cfg"
        ]
      }
    ]
  }

snippet jsonstlink
  {
    "version": "0.2.0",
    "configurations": [
      {
        "cwd": "\${workspaceFolder}",
        "executable": "build/FSMC-Test.elf",
        "name": "Cortex Debug",
        "request": "launch",
        "type": "cortex-debug",
        "runToEntryPoint": "main",
        "servertype": "openocd",
        "showDevDebugOutput": "raw",
        "svdFile": "\${workspaceRoot}/STM32F103xx.svd",
        "configFiles": [
          "\${env:openocd_path}/scripts/interface/stlink.cfg",
          "\${env:openocd_path}/scripts/target/stm32f1x.cfg"
        ]
      }
    ]
  }

snippet jsondaplink
  {
    "version": "0.2.0",
    "configurations": [
      {
        "cwd": "\${workspaceFolder}",
        "executable": "build/FSMC-Test.elf",
        "name": "Cortex Debug",
        "request": "launch",
        "type": "cortex-debug",
        "runToEntryPoint": "main",
        "servertype": "openocd",
        "showDevDebugOutput": "raw",
        "svdFile": "\${workspaceRoot}/STM32F103xx.svd",
        "configFiles": [
          "\${env:openocd_path}/scripts/interface/cmsis-dap.cfg",
          "\${env:openocd_path}/scripts/target/stm32f1x.cfg"
        ]
      }
    ]
  }

snippet json_rtt_cfg
      "rttConfig": {
        "enabled": true,
        "address": "auto",
        "clearSearch": false,
        "polling_interval": 20,
        "decoders": [
          {
            "label": "",
            "port": 0,
            "type": "console"
          }
        ]
      },

snippet json_dap_all
  {
    "version": "0.2.0",
    "configurations": [
      {
        "cwd": "${workspaceFolder}",
        "executable": "build/DCMI.elf",
        "name": "Cortex Debug",
        "request": "launch",
        "type": "cortex-debug",
        "runToEntryPoint": "main",
        "servertype": "openocd",
        "showDevDebugOutput": "raw",
        "svdFile": "${workspaceFolder}/STM32F407.svd",
        "rttConfig": {
          "enabled": true,
          "address": "auto",
          "clearSearch": false,
          "polling_interval": 20,
          "decoders": [
            {
              "label": "",
              "port": 0,
              "type": "console"
            }
          ]
        },
        "configFiles": [
          "${env:openocd_path}/scripts/interface/jlink.cfg",
          "${env:openocd_path}/scripts/target/stm32f4x.cfg"
        ],
        "variableFormat": {
          "decimal": true,
          "hex": true
        },
        "gdbPath": "gdb-multiarch",
        "miDebuggerArgs": [
          "-x",
          "${workspaceFolder}/.gdbinit"
        ]
      }
    ]
  }
